////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//	MathVector.h
//  MathLib
//
//  Created by Gregory Maks on 8/14/09.
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef MATH_VECTOR_H
#define MATH_VECTOR_H

#include "MathDefines.h"



// Predefinitions
struct Matrix4x4;


struct Vector4
{
public:
	// vars
	floatType x, y, z, w;


public:
	void ctor ();

	// constructors
	Vector4 ();
	Vector4 (floatType _x, floatType _y, floatType _z, floatType _w = 1);
	
	// methods
	void AddVector (Vector4 &vec);
	void SubVector (Vector4 &vec);
	void MultByScalar (floatType scalar);
	Vector4 CrossProduct (Vector4 &vec);
	floatType DotProduct (Vector4 &vec);
	void Normalize ();
	floatType Length ();
	floatType LengthSq ();
	void Transform (Matrix4x4 &mat);
	
	// debug methods
	void Printf();
	
	// operators
	Vector4 operator+ (Vector4 &vec);
	Vector4& operator+= (Vector4 &vec);
	Vector4 operator- (Vector4 &vec);
	Vector4& operator-= (Vector4 &vec);
	
	floatType operator* (Vector4 &vec);	//dot-product
	
	Vector4 operator* (floatType val);
	Vector4& operator*= (floatType val);
	
	Vector4 operator* (Matrix4x4 &mat);
	Vector4& operator*= (Matrix4x4 &mat);
	
	Vector4 operator^ (Vector4 &vec);	//cross-product
	Vector4& operator^= (Vector4 &vec);	//cross-product

	bool operator== (Vector4 &vec);
	bool operator!= (Vector4 &vec);
};


#endif //MATH_VECTOR_H